﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DoAnWeb.DAO;

namespace DoAnWeb.DTO
{
    public static class CurrentContext
    {
        public static bool IsLogged
        {
            get { return HttpContext.Current.Request.Cookies["UserDangNhap"] != null; }
        }
        public static string UserName
        {
            get { return HttpContext.Current.Request.Cookies["UserDangNhap"].Value; }
        }
        public static TaiKhoanDTO TaiKhoanDTO
        {
            get { return HttpContext.Current.Session["UserDangNhap"] as TaiKhoanDTO; }
            set { HttpContext.Current.Session["UserDangNhap"] = value; }
        }
        public static MyCart Cart
        {
            get { return CurrentContext.TaiKhoanDTO.Cart; }
        }
        
    }
}